<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>原型对象扩展内置方法</title>
	</head>
	<body>
		<script type="text/javascript">
			Array.prototype.sum = function() {
				var sum = 0;
				for(var i = 0; i < this.length; i++) {
					sum += this[i];
				}
				return sum;
			}
			console.log(Array.prototype);
			var arr = new Array(11,22,33);
			arr.sum();
			console.log(arr.sum())
		</script>
	</body>
</html>
